/**
 * 内部对元素dom执行能力检测并显示重写，原始函数在函数的最末尾重新执行一遍来绑定事件
 */
var A = {};

A.on = function(dom, type, fn) {
    if (dom.addEventListener) {
        A.on = function(dom, type, fn) {
            dom.addEventListener(type, fn, false);
        }
    } else if(dom.attachEvent) {
        A.on = function(dom, type, fn) {
            dom.attachEvent('on' + type, fn);
        }
    } else {
        A.on = function(dom, type, fn) {
            dom['on' + type] = fn;
        }
    }
    A.on(dom, type, fn);
}
